package com.jfeat.am.module.wegou.services.patch.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.jfeat.am.module.wegou.services.patch.TagPatchService;
import com.jfeat.am.module.wegou.services.persistence.dao.RestaurantTagMapper;
import com.jfeat.am.module.wegou.services.persistence.model.RestaurantTag;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2018/1/31.
 */
@Service
public class TagPatchServiceImpl implements TagPatchService{

    @Resource
    RestaurantTagMapper restaurantTagMapper;



    @Override
    public boolean hasChildren(Long id) {
        List<RestaurantTag> restaurantTags = restaurantTagMapper.selectList(new EntityWrapper<RestaurantTag>().eq(RestaurantTag.TAG_ID, id));
        return restaurantTags.size() > 0;
    }

}
